/*
* created by Administrator on 2018/12/13
* 好的代码像粥一样,是得用时间和精力熬的。
*/
/* eslint-disable*/
import router from '../router';
/* eslint-disable*/
export const setInerceptors = (axiosInstance) => {
  axiosInstance.interceptors.request.use(request => request, error => Promise.reject(error));
  axiosInstance.interceptors.response.use(response => {
    if(response.data.code === -10000) {
      router.replace('/auth');
    } else {
      return response
    }
  }, error => Promise.reject(error));
};


